@use './variables' as *;

.collection {
  padding-left: 0;
  list-style-type: none;
  margin: $element-top-margin 0 $element-bottom-margin 0;
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: 2px;
  overflow: hidden;
  position: relative;

  .collection-item {
    background-color: transparent;
    line-height: 1.5rem;
    padding: 10px 20px;
    margin: 0;
    border-bottom: 1px solid var(--md-sys-color-outline-variant);

    // Avatar Collection
    &.avatar {
      min-height: 84px;
      padding-left: 72px;
      position: relative;

      // Don't style circles inside preloader classes.
      &:not(.circle-clipper) > .circle,
      :not(.circle-clipper) > .circle {
        position: absolute;
        width: 42px;
        height: 42px;
        overflow: hidden;
        left: 15px;
        display: inline-block;
        vertical-align: middle;
      }

      i.circle {
        font-size: 18px;
        line-height: 42px;
        color: #fff;
        background-color: var(--md-sys-color-shadow-light);
        text-align: center;
      }


      .title {
        font-size: 16px;
      }

      p {
        margin: 0;
      }

      .secondary-content {
        position: absolute;
        top: 16px;
        right: 16px;
      }
    }

    &:last-child {
      border-bottom: none;
    }

    &.active {
      background-color: var(--md-sys-color-primary);
      color:  var(--md-sys-color-on-primary);

      .secondary-content {
        color:  var(--md-sys-color-on-primary);
      }
    }
  }

  a.collection-item {
    display: block;
    transition: .25s;
    color: var(--md-sys-color-primary);

    &:not(.active) {
      &:hover {
        background-color: rgba(0, 0, 0, 0.04);
      }
    }
  }

  &.with-header {
    .collection-header {
      background-color: transparent;
      border-bottom: 1px solid var(--md-sys-color-outline-variant);
      padding: 10px 20px;
    }

    .collection-item {
      padding-left: 30px;
    }

    .collection-item.avatar {
      padding-left: 72px;
    }
  }

}

// Made less specific to allow easier overriding
.secondary-content {
  float: right;
  color: var(--md-sys-color-primary);
}

.collapsible .collection {
  margin: 0;
  border: none;
}